#include"PlatformAPI.h"

void Platform::Create()
{
	#ifdef WIN32
		WORD v;
		v = MAKEWORD(2,2);
		WSADATA data;
		int err = WSAStartup(v,&data);
	#endif
}

void Platform::Close(SOCKET s)
{
	#ifdef WIN32
		closesocket(s);
	#else
		close(s);
	#endif
}

void Platform::SetNonBlock(SOCKET s)
{
	#ifdef WIN32	
                u_long iMode = 1;
                int ret = ioctlsocket(s, FIONBIO, &iMode);
	#else
		int flags = fcntl(s,F_GETFL,0);
		fcntl(s,F_SETFL,flags|O_NONBLOCK);
	#endif
}
